package cn.geminis.lowcode.compiler.util;

import lombok.SneakyThrows;

/**
 * @author puddi
 */
public class JdkCompilerClass {
    private JdkCompilerClass() {
    }

    public static final Class<?> NAME = getClass("com.sun.tools.javac.util.Name");
    public static final Class<?> LIST = getClass("com.sun.tools.javac.util.List");
    public static final Class<?> TREE_MAKER = getClass("com.sun.tools.javac.tree.TreeMaker");
    public static final Class<?> JC_TREE = getClass("com.sun.tools.javac.tree.JCTree");
    public static final Class<?> JC_VARIABLE_DECL = getClass("com.sun.tools.javac.tree.JCTree$JCVariableDecl");
    public static final Class<?> JC_MODIFIERS = getClass("com.sun.tools.javac.tree.JCTree$JCModifiers");
    public static final Class<?> JC_EXPRESSION = getClass("com.sun.tools.javac.tree.JCTree$JCExpression");
    public static final Class<?> JC_STATEMENT = getClass("com.sun.tools.javac.tree.JCTree$JCStatement");
    public static final Class<?> JC_BLOCK = getClass("com.sun.tools.javac.tree.JCTree$JCBlock");
    public static final Class<?> JC_TYPE_PARAMETER = getClass("com.sun.tools.javac.tree.JCTree$JCTypeParameter");
    public static final Class<?> TYPE_TAG = getClass("com.sun.tools.javac.code.TypeTag");
    public static final Class<?> SYMBOL = getClass("com.sun.tools.javac.code.Symbol");
    public static final Class<?> CLASS_SYMBOL = getClass("com.sun.tools.javac.code.Symbol$ClassSymbol");
    public static final Class<?> PACKAGE_SYMBOL = getClass("com.sun.tools.javac.code.Symbol$PackageSymbol");
    public static final Class<?> WRITEABLE_SCOPE = getClass("com.sun.tools.javac.code.Scope$WriteableScope");
    public static final Class<?> CLASS_WRITER = getClass("com.sun.tools.javac.jvm.ClassWriter");
    public static final Class<?> SYMTAB = getClass("com.sun.tools.javac.code.Symtab");
    public static final Class<?> ENTER = getClass("com.sun.tools.javac.comp.Enter");
    public static final Class<?> GEN = getClass("com.sun.tools.javac.jvm.Gen");
    public static final Class<?> ENV = getClass("com.sun.tools.javac.comp.Env");
    public static final Class<?> JAVA_COMPILER = getClass("com.sun.tools.javac.main.JavaCompiler");
    public static final Class<?> LAMBDA_TO_METHOD = getClass("com.sun.tools.javac.comp.LambdaToMethod");

    @SneakyThrows
    private static Class<?> getClass(String name) {
        return Class.forName(name);
    }
}
